CDTrimImage
Your component receives theCDTrimImage
request whenever an application calls theTrimImage
function. Your component adjusts a compressed image to the boundaries defined by a rectangle specified by your application. The resulting image data is still compressed and is in the same compression format as the source image.
- Note
- The
CDTrimImage
function is optional. If your component doesn't support it, it should return thecodecUnimpError
result code.
pascal ComponentResult CDTrimImage (ImageDescriptionHandle desc, Ptr inData, long inBufferSize, DataProcRecordPtr dataProc, Ptr outData, long outBufferSize, FlushProcRecordPtr flushProc, Rect *trimRect, ProgressProcRecordPtr progressProc);
desc
- Contains a handle to the image description structure that describes the compressed image. Your component updates this image description to refer to the resized image.
inData
- Points to the compressed image data. If the entire compressed image cannot be stored at this location, the application may provide a data-loading function (see the description of the
dataProc
parameter to this function for details). This is a 32-bit clean address.inBufferSize
- Specifies the size of the buffer to be used by the data-loading
function specified by thedataProc
parameter. If the application did not specify a data-loading function, this parameter isnil
.dataProc
- Points to a data-loading function structure. If the data stream is not all in memory when the application calls the Image Compression Manager's
GetCompressedImageSize
function, your component may call an application function that loads more compressed data (see the chapter "Image Compression Manager" in Inside Macintosh: QuickTime for more information about data-loading functions). This parameter contains a pointer to a structure that identifies the data-loading function. If the application did not provide a data-loading function, this parameter isnil
. In this case, the entire image must be in memory at the location specified by theinData
parameter.outData
- Points to a buffer to receive the trimmed image. If there is not sufficient memory to store the compressed image, the application may choose to write the compressed data to mass storage during the compression operation. The
flushProc
parameter identifies the data-unloading function. This is a 32-bit clean address.- Your component should place the actual size of the resulting image into the
dataSize
field of the image description referred to by thedesc
parameter.outBufferSize
- Specifies the size of the buffer to be used by the data-unloading
function specified by theflushProc
parameter. If the application did not specify a data-unloading function, this parameter isnil
.flushProc
- Points to a data-unloading function structure. If there is not enough memory to store the compressed image, your component may call an application function that unloads some of the compressed data (see the chapter "Image Compression Manager" in Inside Macintosh: QuickTime for more information about data-unloading functions). This parameter contains a pointer to a structure that identifies that data-unloading function. If the application did not provide a data-unloading function, this parameter is
nil
. In this case, your component writes the entire compressed image into the memory location specified by theoutData
parameter.trimRect
- Contains a pointer to a rectangle that defines the desired image dimensions. Your component adjusts the rectangle values so that they refer to the same rectangle in the resulting image (this is necessary whenever data is removed from the beginning of the image).
progressProc
- Points to a progress function structure. During the operation, your component should occasionally call an application function to report its progress (see the chapter "Image Compression Manager" in Inside Macintosh: QuickTime for more information about progress functions). This parameter contains a pointer to a structure that identifies that progress function. If the application did not provide a progress function, this parameter is
nil
.DESCRIPTION
Only decompressors receive this request. If theTrimImage
function has been called by an application, the resulting picture should be modified.RESULT CODES
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help